#include "stdafx.h"


#pragma once

#include <vector>
#include "Component.h"
//An Entity is something that has a position, orientation and scale (given by a scenenode). 
//It is given its unique behavior by adding components
namespace Ogrity{
	class GameObject{
	public:
		GameObject(Ogre::SceneManager* sceneMgr, std::string name):m_name(name) { m_sceneNode = sceneMgr->getRootSceneNode()->createChildSceneNode(name + "Node");}

		template <typename T> boost::shared_ptr<T> getComponent();
		template <typename T> boost::shared_ptr<T> getComponentInChildren();
		template <typename T> const std::vector<boost::shared_ptr<T>>& getComponents();
		template <typename T> const std::vector<boost::shared_ptr<T>>& getComponentsInChildren();
		void addComponent(Component const& component);

		Ogre::SceneNode const& sceneNode() const; 
		std::string const& name() const;
	private:

		
		std::vector<boost::shared_ptr<Component>> m_components;
		Ogre::SceneNode* m_sceneNode;
		std::string m_name;
	
	};
}